-const { Clutter, Gio, GLib, Shell } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Shell } = imports.gi;
const CheckBox = imports.ui.checkBox;
const Dialog = imports.ui.dialog;
CLOSED: 2
};
-var AccessDialog = class extends ModalDialog.ModalDialog {
- constructor(invocation, handle, title, subtitle, body, options) {
- super({ styleClass: 'access-dialog' });
+var AccessDialog = GObject.registerClass(
+class AccessDialog extends ModalDialog.ModalDialog {
+ _init(invocation, handle, title, subtitle, body, options) {
+ super._init({ styleClass: 'access-dialog' });
this._invocation = invocation;
this._handle = handle;
});
this.close();
}
-};
+});
var AccessDialogDBus = class {
constructor() {
-const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog;
const AudioDeviceSelectionIface = loadInterfaceXML('org.gnome.Shell.AudioDeviceSelection');
-var AudioDeviceSelectionDialog =
-class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
- constructor(devices) {
- super({ styleClass: 'audio-device-selection-dialog' });
+var AudioDeviceSelectionDialog = GObject.registerClass({
+ Signals: { 'device-selected': { param_types: [GObject.TYPE_UINT] } }
+}, class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
+ _init(devices) {
+ super._init({ styleClass: 'audio-device-selection-dialog' });
this._deviceItems = {};
throw new Error('Too few devices for a selection');
}
- destroy() {
- super.destroy();
- }
-
_buildLayout(devices) {
let title = new St.Label({ style_class: 'audio-selection-title',
text: _("Select Audio Device"),
Main.overview.hide();
app.activate();
}
-};
+});
var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
constructor() {
var WORK_SPINNER_ICON_SIZE = 16;
-var KeyringDialog = class extends ModalDialog.ModalDialog {
- constructor() {
- super({ styleClass: 'prompt-dialog' });
+var KeyringDialog = GObject.registerClass(
+class KeyringDialog extends ModalDialog.ModalDialog {
+ _init() {
+ super._init({ styleClass: 'prompt-dialog' });
this.prompt = new Shell.KeyringPrompt();
this.prompt.connect('show-password', this._onShowPassword.bind(this));
_onCancelButton() {
this.prompt.cancel();
}
-};
+});
var KeyringDummyDialog = class {
constructor() {
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const { Clutter, Gio, GLib, NM, Pango, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, NM, Pango, Shell, St } = imports.gi;
const Signals = imports.signals;
const Config = imports.misc.config;
const VPN_UI_GROUP = 'VPN Plugin UI';
-var NetworkSecretDialog = class extends ModalDialog.ModalDialog {
- constructor(agent, requestId, connection, settingName, hints, flags, contentOverride) {
- super({ styleClass: 'prompt-dialog' });
+var NetworkSecretDialog = GObject.registerClass(
+class NetworkSecretDialog extends ModalDialog.ModalDialog {
+ _init(agent, requestId, connection, settingName, hints, flags, contentOverride) {
+ super._init({ styleClass: 'prompt-dialog' });
this._agent = agent;
this._requestId = requestId;
return content;
}
-};
+});
var VPNRequestHandler = class {
constructor(agent, requestId, authHelper, serviceType, connection, hints, flags) {
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const { AccountsService, Clutter, Gio, GLib,
- Pango, PolkitAgent, Polkit, Shell, St } = imports.gi;
+ GObject, Pango, PolkitAgent, Polkit, Shell, St } = imports.gi;
const Signals = imports.signals;
const Animation = imports.ui.animation;
var WORK_SPINNER_ICON_SIZE = 16;
-var AuthenticationDialog = class extends ModalDialog.ModalDialog {
- constructor(actionId, body, cookie, userNames) {
- super({ styleClass: 'prompt-dialog' });
+var AuthenticationDialog = GObject.registerClass({
+ Signals: { 'done': { param_types: [GObject.TYPE_BOOLEAN] } }
+}, class AuthenticationDialog extends ModalDialog.ModalDialog {
+ _init(actionId, body, cookie, userNames) {
+ super._init({ styleClass: 'prompt-dialog' });
this.actionId = actionId;
this.message = body;
this._wasDismissed = false;
this._sessionUpdatedId = Main.sessionMode.connect('updated', () => {
- this._group.visible = !Main.sessionMode.isLocked;
+ this.visible = !Main.sessionMode.isLocked;
});
this.connect('closed', this._onDialogClosed.bind(this));
this._destroySession();
}
-};
-Signals.addSignalMethods(AuthenticationDialog.prototype);
+});
var AuthenticationAgent = class {
constructor() {
const Mainloop = imports.mainloop;
const { AccountsService, Clutter, Gio,
- GLib, Pango, Polkit, Shell, St } = imports.gi;
+ GLib, GObject, Pango, Polkit, Shell, St } = imports.gi;
const CheckBox = imports.ui.checkBox;
const GnomeSession = imports.misc.gnomeSession;
_endSessionDialog = new EndSessionDialog();
}
-var EndSessionDialog = class EndSessionDialog extends ModalDialog.ModalDialog {
- constructor() {
- super({ styleClass: 'end-session-dialog',
- destroyOnClose: false });
+var EndSessionDialog = GObject.registerClass(
+class EndSessionDialog extends ModalDialog.ModalDialog {
+ _init() {
+ super._init({ styleClass: 'end-session-dialog',
+ destroyOnClose: false });
this._loginManager = LoginManager.getLoginManager();
this._userManager = AccountsService.UserManager.get_default();
Close(parameters, invocation) {
this.close();
}
-};
+});
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const { Clutter, Gio, GLib, Soup, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Soup, St } = imports.gi;
const Config = imports.misc.config;
const ExtensionUtils = imports.misc.extensionUtils;
});
}
-var InstallExtensionDialog =
+var InstallExtensionDialog = GObject.registerClass(
class InstallExtensionDialog extends ModalDialog.ModalDialog {
- constructor(uuid, info, invocation) {
- super({ styleClass: 'extension-dialog' });
+ _init(uuid, info, invocation) {
+ super._init({ styleClass: 'extension-dialog' });
this._uuid = uuid;
this._info = info;
this.close();
}
-};
+});
function init() {
_httpSession = new Soup.SessionAsync({ ssl_use_system_ca_file: true });
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Mainloop = imports.mainloop;
const AccessDialog = imports.ui.accessDialog;
}
}
-var RestartMessage = class extends ModalDialog.ModalDialog {
- constructor(message) {
- super({ shellReactive: true,
- styleClass: 'restart-message headline',
- shouldFadeIn: false,
- destroyOnClose: true });
+var RestartMessage = GObject.registerClass(
+class RestartMessage extends ModalDialog.ModalDialog {
+ _init(message) {
+ super._init({ shellReactive: true,
+ styleClass: 'restart-message headline',
+ shouldFadeIn: false,
+ destroyOnClose: true });
let label = new St.Label({ text: message });
y_align: St.Align.MIDDLE });
this.buttonLayout.hide();
}
-};
+});
function showRestartMessage(message) {
let restartMessage = new RestartMessage(message);
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const { Atk, Clutter, Shell, St } = imports.gi;
+const { Atk, Clutter, GObject, Shell, St } = imports.gi;
const Signals = imports.signals;
const Dialog = imports.ui.dialog;
FADED_OUT: 4
};
-var ModalDialog = class {
- constructor(params) {
+var ModalDialog = GObject.registerClass({
+ Signals: { 'opened': {}, 'closed': {} }
+}, class ModalDialog extends St.Widget {
+ _init(params) {
+ super._init({ visible: false,
+ x: 0,
+ y: 0,
+ accessible_role: Atk.Role.DIALOG });
+
params = Params.parse(params, { shellReactive: false,
styleClass: null,
actionMode: Shell.ActionMode.SYSTEM_MODAL,
this._shouldFadeOut = params.shouldFadeOut;
this._destroyOnClose = params.destroyOnClose;
- this._group = new St.Widget({ visible: false,
- x: 0,
- y: 0,
- accessible_role: Atk.Role.DIALOG });
- Main.layoutManager.modalDialogGroup.add_actor(this._group);
+ Main.layoutManager.modalDialogGroup.add_actor(this);
let constraint = new Clutter.BindConstraint({ source: global.stage,
coordinate: Clutter.BindCoordinate.ALL });
- this._group.add_constraint(constraint);
-
- this._group.connect('destroy', this._onGroupDestroy.bind(this));
+ this.add_constraint(constraint);
this.backgroundStack = new St.Widget({ layout_manager: new Clutter.BinLayout() });
this._backgroundBin = new St.Bin({ child: this.backgroundStack,
x_fill: true, y_fill: true });
this._monitorConstraint = new Layout.MonitorConstraint();
this._backgroundBin.add_constraint(this._monitorConstraint);
- this._group.add_actor(this._backgroundBin);
+ this.add_actor(this._backgroundBin);
this.dialogLayout = new Dialog.Dialog(this.backgroundStack, params.styleClass);
this.contentLayout = this.dialogLayout.contentLayout;
this.buttonLayout = this.dialogLayout.buttonLayout;
if (!this._shellReactive) {
- this._lightbox = new Lightbox.Lightbox(this._group,
+ this._lightbox = new Lightbox.Lightbox(this,
{ inhibitEvents: true,
radialEffect: true });
this._lightbox.highlight(this._backgroundBin);
this._savedKeyFocus = null;
}
- destroy() {
- this._group.destroy();
- }
-
clearButtons() {
this.dialogLayout.clearButtons();
}
return this.dialogLayout.addButton(buttonInfo);
}
- _onGroupDestroy() {
- this.emit('destroy');
- }
-
_fadeOpen(onPrimary) {
if (onPrimary)
this._monitorConstraint.primary = true;
this.dialogLayout.opacity = 255;
if (this._lightbox)
this._lightbox.show();
- this._group.opacity = 0;
- this._group.show();
- Tweener.addTween(this._group,
+ this.opacity = 0;
+ this.show();
+ Tweener.addTween(this,
{ opacity: 255,
time: this._shouldFadeIn ? OPEN_AND_CLOSE_TIME : 0,
transition: 'easeOutQuad',
_closeComplete() {
this.state = State.CLOSED;
- this._group.hide();
+ this.hide();
this.emit('closed');
if (this._destroyOnClose)
this._savedKeyFocus = null;
if (this._shouldFadeOut)
- Tweener.addTween(this._group,
+ Tweener.addTween(this,
{ opacity: 0,
time: OPEN_AND_CLOSE_TIME,
transition: 'easeOutQuad',
return;
let focus = global.stage.key_focus;
- if (focus && this._group.contains(focus))
+ if (focus && this.contains(focus))
this._savedKeyFocus = focus;
else
this._savedKeyFocus = null;
- Main.popModal(this._group, timestamp);
+ Main.popModal(this, timestamp);
this._hasModal = false;
if (!this._shellReactive)
let params = { actionMode: this._actionMode };
if (timestamp)
params['timestamp'] = timestamp;
- if (!Main.pushModal(this._group, params))
+ if (!Main.pushModal(this, params))
return false;
this._hasModal = true;
}
});
}
-};
-Signals.addSignalMethods(ModalDialog.prototype);
+});
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Signals = imports.signals;
const Main = imports.ui.main;
var DIALOG_GROW_TIME = 0.1;
-var RunDialog = class extends ModalDialog.ModalDialog {
- constructor() {
- super({ styleClass: 'run-dialog',
- destroyOnClose: false });
+var RunDialog = GObject.registerClass(
+class RunDialog extends ModalDialog.ModalDialog {
+ _init() {
+ super._init({ styleClass: 'run-dialog',
+ destroyOnClose: false });
this._lockdownSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
this._terminalSettings = new Gio.Settings({ schema_id: TERMINAL_SCHEMA });
super.open();
}
-};
-Signals.addSignalMethods(RunDialog.prototype);
+});
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const { Clutter, Gio, GLib, Pango, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Pango, Shell, St } = imports.gi;
const Signals = imports.signals;
const Animation = imports.ui.animation;
}
};
-var ShellMountQuestionDialog = class extends ModalDialog.ModalDialog {
- constructor(icon) {
- super({ styleClass: 'mount-dialog' });
+var ShellMountQuestionDialog = GObject.registerClass({
+ Signals: { 'response': { param_types: [GObject.TYPE_INT] } }
+}, class ShellMountQuestionDialog extends ModalDialog.ModalDialog {
+ _init(icon) {
+ super._init({ styleClass: 'mount-dialog' });
this._content = new Dialog.MessageDialogContent({ icon });
this.contentLayout.add(this._content, { x_fill: true, y_fill: false });
_setLabelsForMessage(this._content, message);
_setButtonsForChoices(this, choices);
}
-};
-Signals.addSignalMethods(ShellMountQuestionDialog.prototype);
-
-var ShellMountPasswordDialog = class extends ModalDialog.ModalDialog {
- constructor(message, icon, flags) {
+});
+
+var ShellMountPasswordDialog = GObject.registerClass({
+ Signals: { 'response': { param_types: [GObject.TYPE_INT,
+ GObject.TYPE_STRING,
+ GObject.TYPE_BOOLEAN,
+ GObject.TYPE_BOOLEAN,
+ GObject.TYPE_BOOLEAN,
+ GObject.TYPE_UINT] } }
+}, class ShellMountPasswordDialog extends ModalDialog.ModalDialog {
+ _init(message, icon, flags) {
let strings = message.split('\n');
let title = strings.shift() || null;
let body = strings.shift() || null;
- super({ styleClass: 'prompt-dialog' });
+ super._init({ styleClass: 'prompt-dialog' });
let disksApp = Shell.AppSystem.get_default().lookup_app('org.gnome.DiskUtility.desktop');
}
_onCancelButton() {
- this.emit('response', -1, '', false);
+ this.emit('response', -1, '', false, false, false, 0);
}
_onUnlockButton() {
this._hiddenVolume.actor.checked,
this._systemVolume &&
this._systemVolume.actor.checked,
- pim);
+ parseInt(pim));
}
_onKeyfilesCheckboxClicked() {
);
this._onCancelButton();
}
-};
+});
-var ShellProcessesDialog = class extends ModalDialog.ModalDialog {
- constructor(icon) {
- super({ styleClass: 'mount-dialog' });
+var ShellProcessesDialog = GObject.registerClass({
+ Signals: { 'response': { param_types: [GObject.TYPE_INT] } }
+}, class ShellProcessesDialog extends ModalDialog.ModalDialog {
+ _init(icon) {
+ super._init({ styleClass: 'mount-dialog' });
this._content = new Dialog.MessageDialogContent({ icon });
this.contentLayout.add(this._content, { x_fill: true, y_fill: false });
_setLabelsForMessage(this._content, message);
_setButtonsForChoices(this, choices);
}
-};
-Signals.addSignalMethods(ShellProcessesDialog.prototype);
+});
const GnomeShellMountOpIface = loadInterfaceXML('org.Gtk.MountOperationHandler');
details['password'] = GLib.Variant.new('s', password);
details['hidden_volume'] = GLib.Variant.new('b', hiddenVolume);
details['system_volume'] = GLib.Variant.new('b', systemVolume);
- details['pim'] = GLib.Variant.new('u', parseInt(pim));
+ details['pim'] = GLib.Variant.new('u', pim);
}
this._clearCurrentRequest(response, details);
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const { Clutter, Gio, GLib, Shell } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Shell } = imports.gi;
const Dialog = imports.ui.dialog;
const Main = imports.ui.main;
}
};
-var GeolocationDialog = class extends ModalDialog.ModalDialog {
- constructor(name, subtitle, reqAccuracyLevel) {
- super({ styleClass: 'geolocation-dialog' });
+var GeolocationDialog = GObject.registerClass({
+ Signals: { 'response': { param_types: [GObject.TYPE_UINT] } }
+}, class GeolocationDialog extends ModalDialog.ModalDialog {
+ _init(name, subtitle, reqAccuracyLevel) {
+ super._init({ styleClass: 'geolocation-dialog' });
this.reqAccuracyLevel = reqAccuracyLevel;
let icon = new Gio.ThemedIcon({ name: 'find-location-symbolic' });
this.emit('response', GeoclueAccuracyLevel.NONE);
this.close();
}
-};
-Signals.addSignalMethods(GeolocationDialog.prototype);
+});
}
});
-var NMWirelessDialog = class extends ModalDialog.ModalDialog {
- constructor(client, device) {
- super({ styleClass: 'nm-dialog' });
+var NMWirelessDialog = GObject.registerClass(
+class NMWirelessDialog extends ModalDialog.ModalDialog {
+ _init(client, device) {
+ super._init({ styleClass: 'nm-dialog' });
this._client = client;
this._device = device;
Main.sessionMode.disconnect(id);
this.close();
});
+
+ this.connect('destroy', this._onDestroy.bind(this));
}
- destroy() {
+ _onDestroy() {
if (this._apAddedId) {
GObject.Object.prototype.disconnect.call(this._device, this._apAddedId);
this._apAddedId = 0;
Mainloop.source_remove(this._scanTimeoutId);
this._scanTimeoutId = 0;
}
-
- super.destroy();
}
_onScanTimeout() {
this._itemBox.grab_key_focus();
});
}
-};
+});
var NMDeviceWireless = class {
constructor(client, device) {
const GsdWacomIface = loadInterfaceXML('org.gnome.SettingsDaemon.Wacom');
const GsdWacomProxy = Gio.DBusProxy.makeProxyWrapper(GsdWacomIface);
-var DisplayChangeDialog = class extends ModalDialog.ModalDialog {
- constructor(wm) {
- super({ styleClass: 'prompt-dialog' });
+var DisplayChangeDialog = GObject.registerClass(
+class DisplayChangeDialog extends ModalDialog.ModalDialog {
+ _init(wm) {
+ super._init({ styleClass: 'prompt-dialog' });
this._wm = wm;
this._wm.complete_display_change(true);
this.close();
}
-};
+});
var WindowDimmer = class {
constructor(actor) {